@model ShivamEMR.Model.Domain.PatientDomain.Medication

@* This partial view defines form fields that will appear when creating and editing entities *@

<div class="editor-label">
    @Html.LabelFor(model => model.DateAndTime)
</div>
<div class="editor-field">
    @Html.EditorFor(model => model.DateAndTime)
    @Html.ValidationMessageFor(model => model.DateAndTime)
</div>

<div class="editor-label">
    @Html.LabelFor(model => model.Reason)
</div>
<div class="editor-field">
    @Html.EditorFor(model => model.Reason)
    @Html.ValidationMessageFor(model => model.Reason)
</div>

<div class="editor-label">
    @Html.LabelFor(model => model.ForDays)
</div>
<div class="editor-field">
    @Html.EditorFor(model => model.ForDays)
    @Html.ValidationMessageFor(model => model.ForDays)
</div>

<div class="editor-label">
    @Html.LabelFor(model => model.Direction)
</div>
<div class="editor-field">
    @Html.EditorFor(model => model.Direction)
    @Html.ValidationMessageFor(model => model.Direction)
</div>

<div class="editor-label">
    @Html.LabelFor(model => model.Notes)
</div>
<div class="editor-field">
    @Html.EditorFor(model => model.Notes)
    @Html.ValidationMessageFor(model => model.Notes)
</div>

<div class="editor-label">
    Drug
</div>
<div class="editor-field">
    @Html.DropDownListFor(model => model.DrugID, ((IEnumerable<ShivamEMR.Model.Domain.PharmacyDomain.Drug>)ViewBag.PossibleDrugs).Select(option => new SelectListItem {
        Text = Html.DisplayTextFor(_ => option).ToString(), 
        Value = option.ID.ToString(),
        Selected = (Model != null) && (option.ID == Model.DrugID)
    }), "Choose...")
    @Html.ValidationMessageFor(model => model.DrugID)
</div>
<div class="editor-label">
    MedicationStatus
</div>
<div class="editor-field">
    @Html.DropDownListFor(model => model.MedicationStatusID, ((IEnumerable<ShivamEMR.Model.Domain.PatientDomain.MedicationStatus>)ViewBag.PossibleMedicationStatus).Select(option => new SelectListItem {
        Text = Html.DisplayTextFor(_ => option).ToString(), 
        Value = option.ID.ToString(),
        Selected = (Model != null) && (option.ID == Model.MedicationStatusID)
    }), "Choose...")
    @Html.ValidationMessageFor(model => model.MedicationStatusID)
</div>
<div class="editor-label">
    Patient
</div>
<div class="editor-field">
    @Html.DropDownListFor(model => model.PatientID, ((IEnumerable<ShivamEMR.Model.Domain.PatientDomain.Patient>)ViewBag.PossiblePatients).Select(option => new SelectListItem {
        Text = (option == null ? "None" : option.Title), 
        Value = option.ID.ToString(),
        Selected = (Model != null) && (option.ID == Model.PatientID)
    }), "Choose...")
    @Html.ValidationMessageFor(model => model.PatientID)
</div>
<div class="editor-label">
    Doctor
</div>
<div class="editor-field">
    @Html.DropDownListFor(model => model.DoctorID, ((IEnumerable<ShivamEMR.Model.Domain.DoctorsDomain.Doctor>)ViewBag.PossibleDoctors).Select(option => new SelectListItem {
        Text = (option == null ? "None" : option.Title), 
        Value = option.ID.ToString(),
        Selected = (Model != null) && (option.ID == Model.DoctorID)
    }), "Choose...")
    @Html.ValidationMessageFor(model => model.DoctorID)
</div>
<div class="editor-label">
    Diagnosis
</div>
<div class="editor-field">
    @Html.DropDownListFor(model => model.DiagnosisID, ((IEnumerable<ShivamEMR.Model.Domain.PatientDomain.Diagnosis>)ViewBag.PossibleDiagnosis).Select(option => new SelectListItem {
        Text = (option == null ? "None" : option.Title), 
        Value = option.ID.ToString(),
        Selected = (Model != null) && (option.ID == Model.DiagnosisID)
    }), "Choose...")
    @Html.ValidationMessageFor(model => model.DiagnosisID)
</div>
